﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserAdmin.aspx.cs" Inherits="MemberMgr.Website.Admin.UserAdmin" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="zh-CN" />
    <ext:Viewport runat="server" Layout="border">
        <Items>
            <ext:FormPanel runat="server" Region="North" Title="查询条件" Padding="5" Height="100"
                Frame="true" Margins="5 5 5 5" Layout="Table" Icon="Magnifier">
                <Items>
                    <ext:TableLayout ID="tblLayout" runat="server" Columns="4" LabelWidth="70" LabelAlign="Right">
                        <Cells>
                            <ext:Cell ColSpan="2">
                                <ext:TextField ID="txtSearchName" runat="server" Text="" FieldLabel="用户名称">
                                </ext:TextField>
                            </ext:Cell>
                            <ext:Cell ColSpan="2">
                                <ext:ComboBox ForceSelection="true" Editable="false" ID="cmbShopSearch" runat="server" FieldLabel="所属店铺">
                                </ext:ComboBox>
                            </ext:Cell>
                        </Cells>
                    </ext:TableLayout>
                </Items>
                <Buttons>
                    <ext:Button ID="btnSearch" Type="Button" runat="server" Text=" 查 询 ">
                        <DirectEvents>
                            <Click OnEvent="btnSearch_Click" DisableCaching="true">
                                <EventMask ShowMask="true" Msg="正在查询，请稍后..." />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
            <ext:GridPanel ID="gpUserInfo" runat="server" Title="登录用户列表" Margins="0 0 5 5" Icon="UserSuit"
                Region="Center" Frame="true">
                <Store>
                    <ext:Store ID="storeUserList" runat="server" OnRefreshData="storeUserList_Refresh">
                        <Reader>
                            <ext:JsonReader IDProperty="ID">
                                <Fields>
                                    <ext:RecordField Name="USERID" />
                                    <ext:RecordField Name="USERNAME" />
                                    <ext:RecordField Name="EMAIL" />
                                    <ext:RecordField Name="SHOPID" Type="Int" />
                                    <ext:RecordField Name="ROLEID" Type="Int" />
                                    <ext:RecordField Name="SHOPNAME" />
                                    <ext:RecordField Name="ROLENAME" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:Column DataIndex="USERID" Header="登录ID" Width="60" />
                        <ext:Column DataIndex="USERNAME" Header="用户名称" Width="100" />
                        <ext:Column DataIndex="EMAIL" Header="Email" Width="60" />
                        <ext:Column DataIndex="SHOPNAME" Header="所属店铺" />
                        <ext:Column DataIndex="ROLENAME" Header="角色" Width="60" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="rowSelModelMember" runat="server" SingleSelect="true">
                        <DirectEvents>
                            <RowSelect OnEvent="RowSelect" Buffer="100">
                                <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{fpUserDetail}" />
                                <ExtraParams>
                                    <ext:Parameter Name="userID" Value="this.getSelected().id" Mode="Raw" />
                                </ExtraParams>
                            </RowSelect>
                        </DirectEvents>
                    </ext:RowSelectionModel>
                </SelectionModel>
                <BottomBar>
                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" />
                </BottomBar>
                <LoadMask ShowMask="true" />
            </ext:GridPanel>
            <ext:FormPanel ID="fpUserDetail" runat="server" Region="East" Split="true" Margins="0 5 5 5"
                Frame="true" Title="用户详细信息" Width="280" Icon="User" DefaultAnchor="100%">
                <Items>
                    <ext:Hidden ID="txtID" runat="server" DataIndex="Id" />
                    <ext:TextField ID="txtUserID" runat="server" FieldLabel="登录ID" DataIndex="Userid" />
                    <ext:TextField ID="txtPassword1" runat="server" FieldLabel="登录密码" DataIndex="Password1" />
                    <ext:TextField ID="txtPassword2" runat="server" FieldLabel="确认密码" DataIndex="Password2" />
                    <ext:TextField ID="txtUserName" runat="server" FieldLabel="用户姓名" DataIndex="Username" />
                    <ext:TextField ID="txtUserEmail" runat="server" FieldLabel="Email" DataIndex="Email" />
                    <ext:ComboBox ID="cmbShopID" runat="server" FieldLabel="所属商店" DataIndex="Shopid" />
                    <ext:ComboBox ID="cmbRoleID" runat="server" FieldLabel="角色" DataIndex="Roleid" />
                </Items>
                <Buttons>
                    <ext:Button ID="btnAdd" runat="server" Type="Button" Text="添加用户信息" Icon="UserAdd" OnClientClick="#{fpUserDetail}.getForm().reset()">
                    </ext:Button>
                    <ext:Button ID="btnDelete" runat="server" Type="Button" Text="删除用户" Icon="UserDelete">
                        <DirectEvents>
                            <Click OnEvent="btnDelete_Click" >
                                <Confirmation Message="确定删除当前用户吗?" ConfirmRequest="true"  />
                                <EventMask ShowMask="true" Msg="正在删除,请稍后..." />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                    <ext:Button ID="btnSave" runat="server" Type="Button" Text=" 保 存 " Icon="DatabaseSave">
                        <DirectEvents>
                            <Click OnEvent="btnSave_Click" DisableCaching="true">
                                <EventMask ShowMask="true" Msg="正在保存，请稍后..." />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
